package com.rzjm.exercise.sys.core.file.domain;

import java.io.Serializable;
import java.util.Date;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 文件上传
 *
 * @author chglee
 * @email 1992lcg@163.com
 * @date 2017-09-19 16:02:20
 */
@Data
@TableName("sys_file")
public class FileDO implements Serializable {
    private static final long serialVersionUID = 1L;

    //
    private Long id;
    // 文件类型
    private Integer type;
    // URL地址
    private String url;
    // 创建时间
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createDate;
    // 关联id
    private String associatedId;
    private String imgType;
    private Integer imgId;


    public FileDO() {
        super();
    }


    public FileDO(Integer type, String url, Date createDate) {
        super();
        this.type = type;
        this.url = url;
        this.createDate = createDate;
    }
    
    public FileDO(Integer type, String url, Date createDate, String associatedId, Integer imgId, String imgType) {
    	super();
    	this.type = type;
    	this.url = url;
    	this.createDate = createDate;
    	this.associatedId = associatedId;
        this.imgType = imgType;
        this.imgId = imgId;
    }

    @Override
    public String toString() {
        return "FileDO{" +
                "id=" + id +
                ", type=" + type +
                ", url='" + url + '\'' +
                ", createDate=" + createDate +
                ", imgType=" + imgType +
                ", imgId=" + imgId +
                '}';
    }
}
